local mainboot=$(getprop persist.sys.timezone)

case "$mainboot" in
    # 中国大陆地区时区
    Asia/Shanghai|Asia/Beijing|Asia/Chongqing|Asia/Harbin|Asia/Urumqi|Asia/Kashgar)
main_001="\033[1;36m▶ 开始下载前置文件...\033[0m"
main_002="\033[1;33m⚠ 这个版本下载很慢\033[0m"
main_003="\033[1;32m✓ 但是兼容性很高\033[0m"
main_004="\033[1;35m💡 所以就这样把\033[0m"
main_005="\033[1;32m🎉 完成！\033[0m"
        ;;
    *)
main_001="\033[1;36m▶ Starting to download prerequisite files...\033[0m"
main_002="\033[1;33m⚠ This version downloads very slowly\033[0m"
main_003="\033[1;32m✓ But has high compatibility\033[0m"
main_004="\033[1;35m💡 So that's how it is\033[0m"
main_005="\033[1;32m🎉 Completed!\033[0m"
        ;;
esac
clear
echo -e "$main_001"
busybox wget -q -O "structure.sh" "https://gitee.com/BOT_141_2580/sync_flow/raw/master/%E7%BB%93%E6%9E%84%E4%BD%93/structure.sh"
sleep 2.95
clear
echo -e "$main_002"
busybox wget -q -O "Functional.sh" "https://gitee.com/BOT_141_2580/sync_flow/raw/master/%E5%87%BD%E6%95%B0%E5%BA%93/Functional.sh"
sleep 2.95
clear
echo -e "$main_003"
busybox wget -q -O "interface.sh" "https://gitee.com/BOT_141_2580/sync_flow/raw/master/%E8%BE%93%E5%87%BA%E7%95%8C%E9%9D%A2/interface.sh"
clear
echo -e "$main_004"
busybox wget -q -O "Localization.sh" "https://gitee.com/BOT_141_2580/sync_flow/raw/master/%E6%9C%AC%E5%9C%B0%E5%8C%96/Localization.sh"
clear
echo -e "$main_005"
sleep 2.95


source ./interface.sh
source ./Functional.sh
source ./structure.sh
source ./Localization.sh
rm -f  ./Localization.sh ./structure.sh ./Functional.sh ./interface.sh ./main.sh
全局变量
环境判断
mkdir /storage/emulated/0/DCIM/automation

while true ; do
    
    clear
    $current_menu
    
    detect=$(无需按回车检查用户输入)
    
    case "$current_menu" in
        "主菜单")
            case $detect in
                
                1) current_menu="游戏选择" ;;

                2) current_menu="清理设备菜单" ;;

                3) 清理游戏下发文件 ;;

                4) 清理驱动残留文件 ;;

                0) exit 0 ;;
                *) echo -e "${RED}重新输入${NC}"; sleep 0.5 ;;
            esac ;;
        "清理设备菜单")
            case $detect in
                1) 清理驱动残留文件 ;;
                2) 解决牛头futile_hide_10 ;;
                3) 修改设备ID ;;
                0) current_menu="主菜单" ;;
                *) echo -e "${RED}重新输入${NC}"; sleep 0.5 ;;
            esac ;;        
        "游戏选择")
            case $detect in
                1) is_BG_PUBG="和平精英" ; current_menu="KC-KPM_选择";;

                2) is_BG_PUBG="PUBG Mobile" ; current_menu="KC-KPM_选择" ;;

                0) current_menu="主菜单" ;;
                *) echo -e "${RED}重新输入${NC}"; sleep 0.5 ;;
            esac ;;
        "KC-KPM_选择")
            case $detect in
                1) is_KC_KPM=KPM ; current_menu="云端-本地_选择" ;;

                2) is_KC_KPM=KC  ; current_menu="云端-本地_选择" ;;  

                9) current_menu="主菜单" ;;
                0) current_menu="游戏选择" ;;
                *) echo -e "${RED}重新输入${NC}"; sleep 0.5 ;;
            esac ;;
        "云端-本地_选择")
            case $detect in
                1) is_local_cloud="本地" ; current_menu="保存or加载" ;;  

                2) is_local_cloud="云端" ; current_menu="保存or加载" ;;  

                9) current_menu="主菜单" ;;
                0) current_menu="KC-KPM_选择" ;;
                *) echo -e "${RED}重新输入${NC}"; sleep 0.5 ;;
            esac ;;
        "保存or加载")
            case $detect in
                1) current_menu="保存" ;;

                2) current_menu="加载" ;;

                9) current_menu="主菜单" ;;
                0) current_menu="云端-本地_选择" ;;
                *) echo -e "${RED}重新输入${NC}"; sleep 0.5 ;;
            esac ;;
        "保存")
            case $detect in
                1) Save="1" ; 保存or加载函数 ;;

                2) Save="2" ; 保存or加载函数 ;;

                3) Save="3" ; 保存or加载函数 ;;

                9) current_menu="主菜单" ;;
                0) current_menu="云端-本地_选择" ;;
                *) echo -e "${RED}重新输入${NC}"; sleep 0.5 ;;
            esac ;;
        "加载")
            case $detect in
                1) Save="1" ; 保存or加载函数 ;;

                2) Save="2" ; 保存or加载函数 ;;

                3) Save="3" ; 保存or加载函数 ;;
                
                9) current_menu="主菜单" ;;
                0) current_menu="云端-本地_选择" ;;
                *) echo -e "${RED}重新输入${NC}"; sleep 0.5 ;;
            esac ;;
    esac
done

